﻿#region 命名空间

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using Sharp.Domain.CMSBoundedContext.AritcleModule.Aggregates;

using Sharp.Domain.Model;
using Sharp.Infrastructure;
using System.ComponentModel.DataAnnotations;

#endregion

namespace Sharp.Domain.CMSBoundedContext.VIUModule.Aggregates
{
    /// <summary>
    ///  价值信息单元
    /// </summary>
    public partial class VIU : AggregateRoot, IStandardEntity, IStandardState
    {
        public VIU()
        {
            Diggs = new List<Digg>();
            Fields = new List<Field>();
            Tags = new List<Tag>();
            MultiMedias = new List<MultiMedia>();
            ApproveHistories = new List<ApproveHistory>();
        }

        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }


        /// <summary>
        /// 编辑
        /// </summary>
        [Index("IX_VIU_Editor", 1)]
        public Guid? EditorId { get; set; }

        /// <summary>
        /// 总点击
        /// </summary>
        public int Hits { get; set; }
        /// <summary>
        /// 日点击
        /// </summary>
        public int DayHits { get; set; }
        /// <summary>
        /// 周点击
        /// </summary>
        public int WeekHits { get; set; }
        /// <summary>
        /// 月点击
        /// </summary>
        public int MonthHits { get; set; }
        /// <summary>
        /// 评级
        /// </summary>
        public byte Stars { get; set; }

        /// <summary>
        /// 是否头条
        /// </summary>
        public bool IsHeadline { get; set; }

        /// <summary>
        /// 推荐
        /// </summary>
        public bool IsElite { get; set; }
        /// <summary>
        /// 置顶
        /// </summary>
        public bool IsOnTop { get; set; }
        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsDeleted { get; set; }
        /// <summary>
        /// 是否审核
        /// </summary>
        [Index("IX_VIU_IsChecked", 0)]
        public bool IsChecked { get; set; }

        /// <summary>
        /// 允许评论
        /// </summary>
        public bool AllowComment { get; set; }

        /// <summary>
        /// 最后点击
        /// </summary>
        public System.DateTime? LastHitTime { get; set; }

        /// <summary>
        /// 评论数量
        /// </summary>
        public int CommentQuantity { get; set; }
        /// <summary>
        /// 评论分数
        /// </summary>
        public int CommentScore { get; set; }
        /// <summary>
        /// 分类id
        /// </summary>
        public Guid CategoryId { get; set; }
        /// <summary>
        /// 类型
        /// </summary>
        [ForeignKey("CategoryId")]
        public VIUCategory Category { get; set; }


        public string Content { get; set; }
        /// <summary>
        /// 作者
        /// </summary>
        public string Author { get; set; }
        /// <summary>
        /// 来源
        /// </summary>
        public string ComeFrom { get; set; }
        /// <summary>
        /// 缩略图
        /// </summary>
        [StringLength(255)]
        public string ThumbUrl { get; set; }

        public Guid? ArticleId { get; set; }
        [ForeignKey("ArticleId")]
        public Article Article { get; set; }

        ///// <summary>
        ///// 编辑
        ///// </summary>
        //[ForeignKey("EditorId")]
        //public virtual User Editor { get; set; }

        /// <summary>
        /// 性质
        /// </summary>
        public int Nature { get; set; }
        /// <summary>
        /// 关注度
        /// </summary>
        public VIUInterest Interest { get; set; }
        /// <summary>
        /// 重要性
        /// </summary>
        public VIUImportance Importance { get; set; }
        /// <summary>
        /// 风格
        /// </summary>
        public VIUStyle Style { get; set; }
        /// <summary>
        /// 事件时间
        /// </summary>
        public DateTime? EventDay { get; set; }

        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTime? PublishDay { get; set; }

        /// <summary>
        /// 添加日期
        /// </summary>
        /// <value>添加日期</value>
        public System.DateTime? CheckInTime { get; set; }
        /// <summary>
        /// 录入员的id
        /// </summary>
        /// <value>录入员的id</value>
        public Guid? CheckInUserId { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        /// <value>修改时间</value>
        public System.DateTime? ModifiTime { get; set; }
        /// <summary>
        /// 修改数据的用户Id
        /// </summary>
        /// <value>修改数据的用户Id</value>
        public Guid? ModifiedUserId { get; set; }
        [Index]
        [Index("IX_VIU_IsChecked", 1)]
        [Index("IX_VIU_Editor", 0)]
        public EntityStateOperate EntityState { get; set; }

        /// <summary>
        /// 审核信息
        /// </summary>
        public virtual ICollection<ApproveHistory> ApproveHistories { get; set; }

        public virtual ICollection<Digg> Diggs { get; set; }
        /// <summary>
        /// 领域
        /// </summary>
        public virtual ICollection<Field> Fields { get; set; }

        /// <summary>
        /// 属性
        /// </summary> 
        public ICollection<Tag> Tags { get; set; }
        public virtual ICollection<MultiMedia> MultiMedias { get; set; }
        public virtual ICollection<Special> Specials { get; set; }

        /// <summary>
        /// VIU关注度
        /// </summary>
        public enum VIUInterest
        {
            A = 0, B = 1, C = 3, D = 4
        }
        /// <summary>
        /// VIU重要性
        /// </summary>
        public enum VIUImportance
        {
            A = 0, B = 1, C = 3, D = 4
        }
        /// <summary>
        /// VIU风格
        /// </summary>
        public enum VIUStyle
        {

            /// <summary>
            /// 轻松
            /// </summary>
            [Description("轻松")]
            A = 0,
            /// <summary>
            /// 普通
            /// </summary>
            [Description("普通")]
            B = 1,
            /// <summary>
            /// 严肃
            /// </summary>
            [Description("严肃")]
            C3 = 2
        }
    }
}